<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        function binaryInsertSort(arr,start,end){
            var tmp = arr[start];
            for (var i = start+1; i <= end; ++i)
            {
                tmp = arr[i];
                var j = i - 1;
                while (j >= start&& arr[j] > tmp)
                {
                    arr[j + 1] = arr[j];
                    --j;
                }
                arr[j + 1] = tmp;
            }
        }
        list = new Array(5,4,6,1,5,2,4);
        for(var i=0;i<list.length;i++){
            document.write(list[i]);
        }
        binaryInsertSort(list,0,list.length-1);
        document.write("开始输出:");
        for(var i=0;i<list.length;i++){
            document.write(list[i]);
        }

    </script>
</head>
<body>

</body>
</html>